/*
 * @Author: huangyq
 * @Date: 2022-04-20 17:03:53
 * @LastEditTime: 2023-12-06 09:40:32
 * @LastEditors: hyq
 * @Description: 用户相关接口
 * @FilePath: /vue3-boilerplate-pc-client/src/apis/portal/UserApi.ts
 */
import { IBaseRequest, IBaseResponse, AxiosPromise } from '@/plugins/httpHelper'
import PortalApi from './PortalApi'

export default class UserApi extends PortalApi {
  static path = super.$basePath + '/user'

  /**
   *
   * @param params
   * @returns
   */
  static queryLoginUserUsingGET = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    // return super.baseGetRequest(this.path + '/info', params)
    return Promise.resolve({
      data: {
        success: true,
        name: 'hyq',
        mobilePhone: '18910424482',
        params
      }
    }) as AxiosPromise
  }

  /**
   *
   * @param params
   * @returns
   */
  static queryUserPageUsingGET = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    // return super.baseGetRequest(this.path + '/info', params)
    return Promise.resolve({
      data: {
        success: true,
        data: [
          { id: 1, name: 'jack', roleName: '角色1' },
          { id: 2, name: 'jack', roleName: '角色1' },
          { id: 3, name: 'jack', roleName: '角色1' },
          { id: 4, name: 'jack', roleName: '角色1' },
          { id: 5, name: 'jack', roleName: '角色1' }
        ],
        params
      }
    }) as AxiosPromise
  }
}
